import argparse

import command


def git_commit():
    parser = argparse.ArgumentParser(description='Git COMMIT Command')
    parser.add_argument('arg', nargs='?', default='', help='gitct [desc]')

    args, unknown_args = parser.parse_known_args()
    command_line = f'git commit -am \"{unknown_args[0] if len(unknown_args) > 0 else args.arg}\"'
    print(command_line)
    command.exe_command(command_line)
    command.exe_command("git push")


if __name__ == '__main__':
    git_commit()
